Skip to content

wsen-pads: Add data ready polling in _ensure_data().#129

Merged
nedseb merged 2 commits intomainfrom
fix/wsen-pads-polling-timeout
Mar 14, 2026
Merged

wsen-pads: Add data ready polling in _ensure_data().#129
nedseb merged 2 commits intomainfrom
fix/wsen-pads-polling-timeout

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 14, 2026

Closes #126

Summary

Replace silent fallthrough after trigger_one_shot() with polling of STATUS_P_DA bit and OSError on timeout, consistent with WSEN-HIDS, LIS2MDL, VL53L1X, APDS9960, and ISM330DL.

Test plan

python3 -m pytest tests/ -k "wsen-pads" -v  # 8 passed

@nedseb nedseb requested a review from Copilot March 14, 2026 22:04
@nedseb nedseb self-assigned this Mar 14, 2026
@nedseb nedseb added the bug Something isn't working label Mar 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the WSEN-PADS driver’s auto-trigger path to actively poll the sensor’s STATUS register after trigger_one_shot() and raise on a bounded timeout, aligning WSEN-PADS behavior with the “data-ready polling” pattern used by several other drivers in this repo.

Changes:

  • Add data-ready polling loop in WSEN_PADS._ensure_data() after one-shot trigger.
  • Raise an error when the data-ready condition is not met within the timeout window.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/wsen-pads/wsen_pads/device.py
Comment thread lib/wsen-pads/wsen_pads/device.py Outdated
Comment thread lib/wsen-pads/wsen_pads/device.py Outdated
@nedseb nedseb merged commit 5ab56ef into main Mar 14, 2026
3 checks passed
@nedseb nedseb deleted the fix/wsen-pads-polling-timeout branch March 14, 2026 22:18
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wsen-pads: Add data ready polling in _ensure_data() for consistency.

2 participants